package com.example.demonstrate.wang.config;

import com.google.common.util.concurrent.RateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static com.example.demonstrate.wang.constants.Constant.SEARCH_RATE_REQUEST_NUM;
/**
 * @Author along
 * @Date 2024/6/11 15:41
 */

@Configuration
public class RateLimiterConfig {

    @Bean
    public RateLimiter searchRateLimiter() {
        return RateLimiter.create(SEARCH_RATE_REQUEST_NUM); // 默认配置，可根据需要调整
    }
}
